package com.dgh.school.mapper;

import com.dgh.school.bean.Participant;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//参会人员持久层
@Mapper
public interface participantMapper {

    //根据会议室名称查询参会人员
    @Select("select * from participant where room_id = #{rid}")
    List<Participant> selectByRid(int rid) throws Exception;

    //添加参会人员
    @Insert("insert into participant values(#{id}) , #{roomId} , #{pName} , #{email})")
    void insert(Participant p) throws Exception;

    //根据 id 删除参会人员
    @Delete("delete from participant where id = #{id}")
    void deleteById(int id) throws Exception;

}
